<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath();%>
<script type="text/javascript" src="<%=path%>/static/js/jquery-1.8.2.min.js"></script>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>i学习</title>
    <link rel="stylesheet" href="<%=path%>/static/css/index.css">
    <link rel="stylesheet" href="<%=path%>/static/css/homeindex.css">
    <link rel="stylesheet" href="<%=path%>/static/css/upload.css">
    <link rel="stylesheet" href="<%=path%>/static/css/home.css">
    <script src="<%=path%>/static/js/head.js"></script>
</head>
<body>
<div id="vue_body">

    <!-- 顶部   -->
    <div class="header">
        <div class="width_1200 clearfix">
            <div class="header_right right_f">
                你好
                <div class="item uname" v-if="user"><c:if test="${sessionScope.user==null}"><a href="login.jsp">请登录</a></c:if>
                    <c:if test="${sessionScope.user!=null}"><a href="homePage.jsp">,${sessionScope.user.userName}!</a></c:if></div>
                <div class="item">欢迎来到i学习！</div>
                <div class="item" ><a href="registration.jsp">[注册]</a></div>
                <div class="item" onclick="exitLogin()">退出</div>
                <div class="item service">客服中心</div>
            </div>

        </div>
    </div>

</div>
<!-- 内容   -->
<div class="logobox width_1200" style="margin-left: 10%">
    <div class="logo left_f">
        <a href="<%=path%>/index?action=getshowlist"><img src="<%=path%>/static/img/logo.jpeg" width="60" height="120"></a>
    </div>
    <div class="searchbox left_f">
        <div class="input clearfix">
            <form action="<%=path%>/index?action=getlistbyname" method="post">
                <input type="text"  style="width: 418px;font-size: 16px" name="videoname" placeholder="请输入关键词">
                <span><input style="margin-left: 66px; text-index:0px;width: 110px;font-size: 22px;border:#000000 2px solid" type="submit" value="站内搜索"></span>
            </form>
        </div>

    </div>

    <a class="myclass left_f" rel="nofollow"
       href="<%=path%>/uploadServlet?action=going" onclick="return uploadex()"> <span class="icons"></span>我要上传</a>

</div>
</div>

<hr style="width:100%;height:3px;">
<div>
<div class="i_bg bg_color">
    <div class="m_content">
        <div class="m_left">
            <div class="left_n">管理中心</div>
            <div class="left_m">
                <div class="left_m_t t_bg1"><a href="<%=path%>/userServlet?action=personInfo">个人中心</a></div>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg2"><a href="<%=path%>/Comment?action=getCommentByUser&currentPage=1">我的评论</a>
                </div>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg3"><a href="<%=path%>/Watch?action=getWatchlist&currentPage=1">观看历史</a></div>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg1"><a href="<%=path%>/uploadServlet?action=going">我要上传</a></div>
            </div>
            <c:if test="${sessionScope.user.userType>2}">
                <div class="left_m">
                    <div class="left_m_t t_bg4"><a href="<%=path%>/userServlet?action=userManage">用户管理</a></div>
                </div>
                <div class="left_m">
                    <div class="left_m_t t_bg5"><a href="<%=path%>/uploadServlet?action=getList&currentPage=1">视频审核</a></div>
                </div>
            </c:if>
        </div>
        <div class="m_right">
            <div class="m_des">
                <table border="0" style="width:870px; line-height:22px;" cellspacing="0" cellpadding="0">
                    <form action="<%=path%>/uploadServlet?action=insertUpload" enctype="multipart/form-data" id="uplo" method="post">
                    <tr style="height: 20px"> <td style="width: 10%">
                        &nbsp;&nbsp;名&nbsp;&nbsp;称&nbsp;&nbsp;：  </td><td  style="width: 25% ;margin: 10px"><input id="name" name="name" style=" border: darkgray 1px solid; " />
                        </td>
                    </tr>
                        <tr style="height: 40px">
                            <td  style="width: 10%">上传文件：</td><td  style="width: 25%"><input style=" border: darkgray 1px solid; " name="fileName" type="file" id="fileName"  accept=".mp4" onchange="upload11()"/>
                        </td>
                        </tr>
                        <tr style="height: 100px">
                            <td>上传描述：</td><td  style="height: 80px"><textarea name="descrtion" style="border: 1px silver solid;width: 400px ;height: 80px"></textarea>
                        </td>
                        </tr>
                        <tr >
                            <td style=" background-color:antiquewhite;text-align: center ;">  <input type="submit" value="提交" style="width: 100px ; height: 30px"/> </td>
                        </tr>
                            </form>
                </table>
            </div>
        </div>
    </div>
    <div class="btmbg">
        <div class="btm">
            <div >
                <div>
                    <span>关于我们</span>
                    <span>联系我们</span>
                    <span>诚聘英才</span>
                    <span>商务合作</span>
                    <span>常见问题</span>
                </div>
                <div>
                    备案许可号：赣ICP备08666666号
                    <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=34019102000100" rel="nofollow">皖公网安备 34019102000100号</a>
                    <span>出版经营许可证</span>
                </div>
                <div>
                    <span>运营公司：江西i学习教育咨询有限公司</span>
                    <span>法律顾问：张律师</span>
                </div>
                <div>
                    Ixuexi,All Rights Reserved.版权所有 i学习
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function upload11() {
    var formData = new FormData();
    var file = document.getElementById('fileName').files[0];
    formData.append("file", file);
    $.ajax({
        type:"post",
        data:formData,
        datatype:"json" ,
        url:"upload?name="+$("#name").val(),
        processData: false,
        contentType: false,
        async:true,
        success:function(result){
            $("#uplo").attr("enctype","application/x-www-form-urlencoded");
            let name1 = $("#name");
            name1.val(name1.val()+".mp4");
        }});
}
</script>
</body>
</html>